# import sys
# sys.setrecursionlimit(1000000)
# dic={0:1,1:1}
# def f(n):
#     if n in dic.keys():
#         return dic[n]
#     dic[n]=f(n-1)+f(n-2)%10000007
#     return dic[n]


# from functools import lru_cache

# 记忆化缓存
# @lru_cache(maxsize=None)
# def f(x):
#     if x==0 or x==1:
#         return 1
#     return f(x-1)+f(x-2)
#
# x=int(input())
# print(f(x))


from functools import lru_cache


# 记忆化缓存
@lru_cache(maxsize=None)
def dfs(x, y, z):
    # 坐标为(x,y),z表示是否使用过背包
    if x == C and y == D:
        return True

    # 如果没有走到终点,那就冲四个方向进行判断:
    for delta_x, delta_y in [(1, 0), (0, 1), (-1, 0), (0, -1)]:
        xx, yy = x + delta_x, y + delta_y
        # 新坐标不越界
        if xx < 0 or xx >= n or y < 0 or yy >= m:
            continue
        # 弱国新坐标比旧坐标低,就能走到新坐标(xx,yy)
        if Map[xx][yy] < Map[x][y]:
            if dfs(xx, yy, z):
                return True
        # 在(x,y)处使用喷气背包
        elif z == False and Map[xx][yy] < Map[x][y] + k:
            if dfs(xx, yy, True):
                return True

    return False


n, m, k = map(int, input().split())
A, B, C, D = map(int, input().split())
A, B, C, D = A - 1, B - 1, C - 1, D - 1
Map = []
for i in range(n):
    Map.append(list(map(int, input().split())))

if dfs(A, B, False):
    print("Yes")
else:
    print("No")
